<h2>Edit Product</h2>
<fieldset>
    <legend>Edit Product</legend>
    <?php
        echo $form->create("Product",array('type'=>'file'));
            echo $form->input("id");
            echo $form->input("product_name");
            echo $form->input("category_id");
            echo $html->image('product/'.$product['Product']['image']);      
            echo $form->input('image', array('type'=>'file')); 
            echo $form->input("description");
        echo $form->end(array('value'=>'Save', 'name'=>'editproduct'));
    ?>
</fieldset>
<h3>Product's size</h3>
<fieldset>
    <legend>Product's Size</legend>
    <table>
        <thead>
            <tr>
                <th>Value</th>
                <th>Price</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach($product['Size'] as $size):?>
            <tr>
                <td><?php print $size['value']?></td>
                <td><?php print $size['price']?> €</td>
                <td><?php print $html->link('delete', array('action'=>'deletesize', $size['id'], 'product'=>$product['Product']['id']))?> , <?php print $html->link('edit', array('action'=>'editsize','product'=>$product['Product']['id'], $size['id']))?></td>
            </tr>
            <?php endforeach;?>
        </tbody>
    </table>
</fieldset>

<h3>Add size</h3>
<fieldset>
    <legend>Add Size</legend>
    <?php
        print $form->create('Size', array('url'=>'/admin/products/edit/'. $product['Product']['id']));
            print $form->input('value');    
            print $form->input('price', array('type'=>'text'));    
        print $form->end(array('value'=>'Save', 'name'=>'addsize'));  
    ?>
</fieldset>